Skip to content

fix(diff): add horizontal scrolling for long lines - #53

Merged
cheat2001 merged 4 commits into
cheat2001:mainfrom
ChrisLauinger77:codex/diff-horizontal-scrollbar
Oct 4, 2026
Merged

cheat2001 merged 4 commits into
cheat2001:mainfrom
ChrisLauinger77:codex/diff-horizontal-scrollbar

Conversation

@ChrisLauinger77

@ChrisLauinger77 ChrisLauinger77 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Long lines in unwrapped diffs could only be reached using horizontal trackpad gestures. Add a horizontal scrollbar that stays at the bottom of the viewport while scrolling vertically, plus Shift+mouse-wheel support. Working-copy changes and code diffs opened from selected commits use this same viewer. Inline and side-by-side views share the same pan controller, so split panes remain aligned and search jumps keep the scrollbar synchronized. Arrow keys operate the focused scrollbar without triggering diff navigation; wrapping removes the scrollbar.

Validation: desktop TypeScript check, all 227 unit tests, and four Chromium browser tests passed. Browser coverage includes the new scrollbar/Shift+wheel regression, horizontal scrolling in a selected commit's inline and split code diffs, first-change auto-jump, and selection/copy while scrolling. Checks used the installed binaries directly because the pnpm wrapper attempted to install dependencies in an unwritable store.

Linux validation: system WebKitGTK 2.52.6 / GTK 3.24.52 smoke checks passed on Wayland and X11, hosting the demo frontend in an ephemeral GTK WebView. Checked working-copy SQL and historical commit code diffs in inline and side-by-side views: scrollbar panning, native ArrowRight input, Shift+wheel, synchronized pane offsets, sticky placement for tall diffs, and hiding the bar when wrapping. The visible thumb was also verified from actual GTK window pixels on X11. Full Tauri/Rust integration was not exercised.

Screenshots

Horizontal scrollbar in the side-by-side diff

Checklist

  • TypeScript and unit tests pass (direct installed binaries)
  • Rust checks and new engine integration tests: not applicable (frontend only)
  • Undo tracking: not applicable (no Git mutations)
  • Colors use design tokens only
  • CLAUDE.md updated with scrollbar behavior and test count
  • Commits carry no trailers from coding tools

@cheat2001 cheat2001 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Chris, this is the right shape. I ran it in both views, the thumb follows the app's thin scrollbar style, the two panes stay locked together, and the pan controller changes keep the G46 work intact. Two things to change and one to know about.

docs/assets/diff-horizontal-scrollbar.png: that folder feeds the website images, so please drop the file from the PR and keep the screenshot in the description only. It already renders there from your fork.

The CLAUDE.md note landed in the middle of the G46 paragraph and splits its sentence ("...stays on the scrolling thread. A sticky horizontal scrollbar... useHorizontalPan therefore sets..."). Make it its own sentence at the end of that entry instead.

Not a blocker: the track spans the whole diff width including the line number gutter, so the thumb sits a little off from where the code actually is. Fine to leave.

You mentioned WebKitGTK is unchecked. If you get a chance to try it there before I merge, say so here, it's the one place I can't look.

@ChrisLauinger77

Copy link
Copy Markdown
Contributor Author

update desc and commits

@ChrisLauinger77
ChrisLauinger77 force-pushed the codex/diff-horizontal-scrollbar branch from 5108aab to 90f9839 Compare October 3, 2026 10:18
@cheat2001
cheat2001 merged commit d42bb98 into cheat2001:main Oct 4, 2026
6 checks passed
@cheat2001

Copy link
Copy Markdown
Owner

Merged and shipped in 0.21.0, thanks Chris. The WebKitGTK check you ran is noted in the release too, that was the one place I couldn't look.

@ChrisLauinger77
ChrisLauinger77 deleted the codex/diff-horizontal-scrollbar branch October 4, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants